package main

import (
	"fmt"
	"net"
	"time"
)

func main() {
	conn, err := net.Dial("tcp", "localhost:8888")
	if err != nil {
		panic(err)
	}
	defer conn.Close()
	_, err = conn.Write([]byte("hello"))
	if err != nil {
		panic(err)
	}

	var body [100]byte
	_, err = conn.Read(body[:])
	if err != nil {
		panic(err)
	}
	fmt.Printf("收到消息: %s\n", body)

	time.Sleep(time.Second * 60)
}
